home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part1 / 4743 < prev    next >
Encoding:
Text File  |  1996-08-05  |  1.1 KB  |  32 lines

  1. Newsgroups: comp.lang.c
  2. Path: wchat.on.ca!news
  3. From: Sean D. Evans <sevans@wchat.on.ca>
  4. Subject: Re: Can main() function be called?
  5. Organization: WorldChat / The Online Source, Burlington Ontario.
  6. Date: Tue, 6 Feb 1996 19:35:15 GMT
  7. Message-ID: <DMDD2r.xu@wchat.on.ca>
  8. X-Nntp-Posting-Host: g2-p12.wchat.on.ca
  9. Sender: news@wchat.on.ca (News Owner)
  10.  
  11. m92fra@sabik.tdb.uu.se (Fredrik Raadesand) writes:
  12. > > I think that it cannot be done, I see no reasonalbe way how main()
  13. > > could be called more than once.
  14. > >
  15. > >
  16. > >  What is your thoughts on this?
  17. > >
  18. > I would say the simplest way to find out is to try it out ?
  19. > ...to post the question on the net is probably more difficult. ;)
  20. > Either it works or it doesn't, right ?
  21. >  /Fredrik
  22. The main() function can be called, but why would you want to do that?
  23. If you were to call the main() function, the original main() would still
  24. be in memory taking up valuable space.  If you need to call main(), just
  25. RETURN to it.  Return a value to main() that will instruct main() to restart
  26. from the beginning (if that is what you are trying to do).
  27.  
  28. Sean D. Evans
  29.